<template>
    <div>
        <div class="title">近日新增课程数</div>
        <el-row>
            <el-table :data="data" height="350" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
                <el-table-column label="日期" prop="createTime" align="center">
                    <template slot-scope="scope">
                        <i class="el-icon-time"></i>{{scope.row.createTime}}
                    </template>
                </el-table-column>
                <el-table-column label="新增数量" prop="count" align="center"></el-table-column>
            </el-table>
        </el-row>
    </div>
</template>

<script>
import { newCourses } from '#/Home/Home'
export default {
    name: 'DataViewFour',
    data() {
        return {
            data: []
        }
    },
    created() {
        this.init();
    },
    methods: {
        async init() {
            await newCourses().then(res => {
                console.log(res)
                if(res.data.ret === 0) {
                    this.data = res.data.data.data.reverse();
                    console.log(this.data)
                }
            })
        }
    }
}
</script>

<style lang="less" scoped>
.title {
  font-weight: bold;
  margin-bottom: 20px;
}
</style>